<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			var reg = /[0-9]+/;
			var reg2 = /[0-9]+/g;
			var str = "hello1234512-12";
			var result = str.match(reg);
			console.log(result);//1234512
			var result2 = str.match(reg2);
			console.log(result2);//["1234512", "12"]
			
			//* 前面那个单元个出现零次或多次
			var reg = /go*gle/;
			var str = "goooooooooogle";//打印所有["goooooooogle"]
			var str = "google";
			var str = "ggle";
			//? 前面那个单元格出现一次或零次
			var reg =/wo?rld/;
			var str = "wrld";//["wrld"]
			var str = "world";//["world"]
			var str = "woorld";//null
			//. 匹配除了换行符\n之外任意一个字符
			var str = "#&*@(^hg45-FDF\ndfyd0fyydf";//["#&*@(^hg45-FDF"]
					// | :或者
			var reg = /milk|fish/;
			var str = "cat like eat fish and milk";//["fish"]
			// \ : 这个符号是用来转义
			//把符号的特殊含义给去掉，只保留原来的意思 \.
			var reg = /[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/;
			var str = "192.168.33.4";//["192.168.33.4"]
			//$ ： 匹配输入字符串的结尾位置
			//^ : 匹配输入字符串的开始位置
			var reg = /^banana/;//这个正则要求banana出现在字符串的开始位置   null
			var reg = /^monkey/;//["monkey"]
		 	var reg = /banana$/;//["banana"]
		 	var reg = /like$/;//null
		 	var str = "monkey and banana";
		 	var reg3 = /13[0-9]{9}/;
		 	var str3 = "13121212121java";
		 	var result3 = str3.match(reg3);
		 	console.log(result3);
		 	//^和$限制被匹配的内容进行“完整匹配”，前后不再有其他的字符
		 	var reg = /^13[0-9]{9}$/;
		 	var str = "13341267121";//["13341267121"]
		</script>
	</head>
	<body>
	</body>
</html>
